package com.slj.mapper;

import com.slj.entity.Book;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author 26607
 * @description 针对表【book】的数据库操作Mapper
 * @createDate 2025-09-02 07:18:41
 * @Entity com.slj.entity.Book
 */
@Mapper
public interface BookMapper {

    //获取总条数
    Integer getBookTotalCount(@Param("bookName") String bookName, @Param("author") String author);

    //获取分页数据
    List<Book> getBookList(@Param("bookName") String bookName,
                           @Param("author") String author,
                           @Param("pageNum") Integer pageNum,
                           @Param("pageSize") Integer pageSize);

    /**
     * 创建新书籍
     */
    Integer addBook(@Param("book") Book book);

    /**
     * 删除书籍
     */
    Integer deleteBook(@Param("id") Integer id);

    //根据id查询书籍
    Book getBookById(@Param("id") Integer id);


    //修改书籍
    Integer updateBook(@Param("book") Book book);
}




